Don't leak pixbufs. (#502250, Yevgen Muntyan)
authorMatthias Clasen <mclasen@redhat.com>
Fri, 7 Dec 2007 18:51:25 +0000 (18:51 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Fri, 7 Dec 2007 18:51:25 +0000 (18:51 +0000)
2007-12-07  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtkfilechooserdefault.c (shortcuts_reload_icons): Don't
        leak pixbufs.  (#502250, Yevgen Muntyan)

svn path=/trunk/; revision=19128

ChangeLog
gtk/gtkfilechooserdefault.c

index 0ab33a248eb763296cb5d330e3aba39265df306a..bb9b29eb7647d761e7cf6ff326c093bbcf0025df 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-12-07  Matthias Clasen  <mclasen@redhat.com>
+
+       * gtk/gtkfilechooserdefault.c (shortcuts_reload_icons): Don't
+       leak pixbufs.  (#502250, Yevgen Muntyan)
+
 2007-12-07  Yevgen Muntyan  <muntyan@tamu.edu>
 
        * gtk/gtkprintunixdialog.c:
index fe958b408aff37c4cb7ca77b51a0299437ee5c29..75a149f0e596693bf46a2b8997f8556f5399fb5b 100644 (file)
@@ -1382,13 +1382,6 @@ shortcuts_reload_icons (GtkFileChooserDefault *impl)
              volume = data;
              pixbuf = gtk_file_system_volume_render_icon (impl->file_system, volume, GTK_WIDGET (impl),
                                                           impl->icon_size, NULL);
-
-             gtk_list_store_set (impl->shortcuts_model, &iter,
-                                 SHORTCUTS_COL_PIXBUF, pixbuf,
-                                 -1);
-
-             if (pixbuf)
-               g_object_unref (pixbuf);
            }
          else if (shortcut_type == SHORTCUT_TYPE_PATH)
             {
@@ -1425,13 +1418,6 @@ shortcuts_reload_icons (GtkFileChooserDefault *impl)
                  icon_theme = gtk_icon_theme_get_for_screen (gtk_widget_get_screen (GTK_WIDGET (impl)));
                  pixbuf = gtk_icon_theme_load_icon (icon_theme, "gnome-fs-share", 
                                                     impl->icon_size, 0, NULL);
-
-                 gtk_list_store_set (impl->shortcuts_model, &iter,
-                                     SHORTCUTS_COL_PIXBUF, pixbuf,
-                                     -1);
-
-                 if (pixbuf)
-                   g_object_unref (pixbuf);
                }
             }
          else if (shortcut_type == SHORTCUT_TYPE_SEARCH)
@@ -1442,6 +1428,14 @@ shortcuts_reload_icons (GtkFileChooserDefault *impl)
             {
               pixbuf = render_recent_icon (impl);
             }
+
+          gtk_list_store_set (impl->shortcuts_model, &iter,
+                             SHORTCUTS_COL_PIXBUF, pixbuf,
+                             -1);
+
+          if (pixbuf)
+            g_object_unref (pixbuf);
+
        }
     }
   while (gtk_tree_model_iter_next (GTK_TREE_MODEL (impl->shortcuts_model),&iter));